<include file='./header' />
<meta http-equiv="Content-Type" content="text/html" charset="utf-8" />
<link rel="stylesheet" type="text/css" href="__ROOT__/css/zc.css"/>
<script type="text/javascript" src="__ROOT__/js/zc.js"></script>

<script type="text/javascript">
var wait=60;
$(function() {
	tabs(".zc_tab","on",".zc_con"); 
	onloadImg(".zc_body");

	//$("#txtMobile").blur(function(){checkMobile(this,"#spanMobile","#getCode")});//手机号码格式判断
	$('#txtMobile').bind('input propertychange', function() {    	
		var txtMobile = $("#txtMobile").val();
   		if(txtMobile.length == 11){
			checkMobile("#txtMobile","#spanMobile","#getCode");	//手机号码格式判断   
    	}
    });	
	$("#txtSmsCode").blur(function(){checkConfirm1(this,"#spanConfirm1")});//验证码1格式判断
	$("#password1").blur(function(){checkPassword(this,"#spanPassword1")});//密码1格式判断
	$("#show_password1").click(function(){swichPassword(this,"#password1")});//显示和隐藏密码1
	$("#txtEmail").blur(function(){checkEmail(this,"#spanEmail")});//eMail格式判断	
	
	//点击发送验证码按钮后倒计时且发送短信
	$("#getCode").click(function(){
		if(!checkMobile("#txtMobile","#spanMobile")){return false;}
		time($("#getCode"));
		$.ajax({  
			type: "post",  
			url: "__URL__/getCode",  
			dataType: 'json',
			data: {mobile:$("#txtMobile").val(),type:"findpwd" }, 
			beforeSend: function(XMLHttpRequest){
			},  
			success: function(json){
				if(json.data > 0){
					$("#spanMobile").html("<i class='fa fa-check-circle'></i>短信发送成功</span>").show();
				}else if(json.data == -99){
					$("#spanMobile").html("<i class='fa fa-times-circle'></i>短信请求次数过多</span>").show();
				}
				else if(json.data == -3){
					$("#spanMobile").html("<i class='fa fa-times-circle'></i>您的手机号已存在</span>").show();	
				}
			} 
		})
	});
	
	//提交手机找回密码
	$("#btnMobileFindpw").click(function(){ 
		if(!checkMobile("#txtMobile","#spanMobile","#getCode")){return false;}//手机号码格式判断
		if(!checkConfirm1("#txtSmsCode","#spanConfirm1")){return false;}//验证码1格式判断
		if(!checkPassword("#password1","#spanPassword1")){return false;}//密码1格式判断
		$(".onload").show();//显示loading
		$.ajax({  
			type: "post",  
			url: "__URL__/findMobilePwd",  
			dataType: 'json',
			data: {mobile:$("#txtMobile").val(),password:$("#password1").val(),smscode:$("#txtSmsCode").val()},
			beforeSend: function(XMLHttpRequest){   
			},  
			success: function(json){
				if(json.data == "1"){
					window.location.href='__URL__/login';
				}else{
					if(json.data=="-2"){
						$("#spanConfirm1").html("<i class='fa fa-times-circle'></i>找回密码失败</span>").show();
					}else if(json.data=="-3"){
						$("#spanMobile").html("<i class='fa fa-times-circle'></i>该帐户已被停用</span>").show();	
					}else if(json.data=="-1"){
						$("#spanConfirm1").html("<i class='fa fa-times-circle'></i>验证码错误</span>").show();
					}else{
						alert(json.info);
					}
					$("#zcLoading1").hide();
						
				}	
			} 
		})
	}); 
	
	//提交邮箱找回密码
	$('#btnEmailFindpw').click(function(){
		if(!checkEmail("#txtEmail","#spanEmail")){return false;}//邮箱地址格式判断
		$(".onload").show();//显示loading
		$.ajax({  
			type: "post",  
			url: "__URL__/findEmailPwdSend",  
			dataType: 'json',
			data: {email:$("#txtEmail").val()},
			beforeSend: function(XMLHttpRequest){   
			},  
			success: function(json){
				if(json.data == 1){
					$("#spanEmail").html("<i class='fa fa-check-circle'></i>"+ json.info +"</span>").show();
				}else{
					$("#spanEmail").html("<i class='fa fa-times-circle'></i>"+ json.info +"</span>").show();
				}
				$("#zcLoading1").hide();
			} 
		})
	})
})      

</script>
</head>

<body>

<!--注册-->
<div class="main">
	<div class="zc_main">
    	<div class="zc_top">
        	<img src="__ROOT__/images/logo2.png" />
        </div>
        <div class="zc_body">
        	<!--<div class="zc_tab">
                <div class="on">通过手机找回</div>
                <div >通过邮箱找回</div>
            </div>
            <div class="zc_con">-->
                <!--手机注册-->
            	<div class="zc_con_list" style="display:block;">
                <input name="hidType" type="hidden" value="1"/>
                    <p>
                        <label>手机号码</label>
                        <input name="mobile" class="form-control w50p" placeholder="手机号码" type="text" id="txtMobile" maxlength="11">
                        <button class="btn btn-default" id="getCode" type="button" style="cursor:not-allowed;" disabled="disabled">获取验证码</button>
                        <span class="notice_wrong" style="display:none" id="spanMobile"></span>
                    </p>                    
                    <p>
                        <label>验&nbsp;证&nbsp;码</label>
                        <input name="txtCode" class="form-control w50p" placeholder="验证码" type="text" maxlength="4" id="txtSmsCode">                        
                        <span class="notice_wrong" style="display:none" id="spanConfirm1"></span>                    	
                    </p>
                    <p>
                        <label>重置密码</label>
                        <input name="password" class="form-control w60p" placeholder="长度在6-12之间，只能包含字符、数字和下划线" type="password" id="password1" maxlength="12">
                        <a class="btn btn-success btn-lg showpw" href="javascript:void(0)" id="show_password1"><i class="fa fa-eye"></i></a>
                        <span class="notice_wrong" style="display:none" id="spanPassword1"></span>
                    </p>
                    <p style="padding-left:20%;position:relative;">
                        <input class="btn btn-danger" value="提 交" id="btnMobileFindpw" type="button">
                    </p>
                     
                </div>
                <!--邮箱注册
                <div class="zc_con_list">
                <input name="hidType" type="hidden" value="2"/>
                    <p>
                        <label>邮箱地址</label>
                        <input name="email" class="form-control w70p" placeholder="邮箱地址" type="text" id="txtEmail">
                        <span class="notice_wrong" style="display:none" id="spanEmail"></span>
                    </p>
                    <p style="padding-left:20%;position:relative;">
                        <input class="btn btn-danger" value="提 交" id="btnEmailFindpw" type="button">
                    </p>   
                </div>-->
            </div>
            <div class="clear"></div>
        </div>
        <!--加载中-->
        <div class="onload" style="display:none" id="zcLoading1">
            <div>
            	<img src="__ROOT__/images/onload.gif" />
            </div>
        </div>
    </div>
</div>
</body>
</html>
